package com.mlnx.netty.app.ecg.session.core;

import java.util.concurrent.ConcurrentHashMap;

import io.netty.channel.Channel;

/**
 * Created by amanda.shan on 2019/8/13.
 */
public interface SessionManager {

    default String getName(){
        return "SessionManager";
    };

    ConcurrentHashMap<String, Session> getSessionClientIdMap();

    ConcurrentHashMap<Channel, Session> getSessionChannelMap();

    default Session getSession(Channel channel) {
        return null;
    }

    default Session getSession(String clientId) {
        return null;
    }

    default void addSession(Session session) {
    }

    default void removeSession(Channel channel) {
        channel.close();
    }

    default void removeSession(String clientId) {
    }

    default void removeSession(Session session) {
    }

}
